<template>
    <ex-dialog v-model="visible" draggable :title="form.orgName"
  width="700" :contentHeight="450">
      <template #default>
        <el-tabs v-model="activeName"  style="height: 100%">
          <el-tab-pane label="基本信息" name="base" style="height: 100%">
            <el-descriptions class="margin-top" :column="2" border>
              <el-descriptions-item label="类型"><ex-label code="ORG_TYPE" :value="form.orgType"/></el-descriptions-item>
              <el-descriptions-item :label="'编码'">{{form.orgCode}}</el-descriptions-item>
              <el-descriptions-item :label="'名称'">{{form.orgName}}</el-descriptions-item>
              <el-descriptions-item :label="'简称'">{{form.simpleName}}</el-descriptions-item>
              <el-descriptions-item label="部门负责人"><ex-label code="SysUser" :value="form.leaderId"/></el-descriptions-item>
              <el-descriptions-item label="排序">{{form.orderWeight}}</el-descriptions-item>
              <el-descriptions-item label="描述" :span="2">{{form.description}}</el-descriptions-item>
              <el-descriptions-item label="机构路径" :span="2">{{form.pathCode}},{{form.levelCode}}</el-descriptions-item>
              <el-descriptions-item label="创建时间"><ex-label format code="DATETIME" :value="form.createTime"/></el-descriptions-item>
              <el-descriptions-item label="创建人"><ex-label code="SysUser" :value="form.createUser"/></el-descriptions-item>
              <el-descriptions-item label="是否可用"><ex-label code="IS_ENABLED" :value="form.isEnabled"/></el-descriptions-item>
            </el-descriptions>
          </el-tab-pane>
          <el-tab-pane label="可用位置" name="Sysposition" style="height: 100%">
          <ex-rel-table ref="positionRelTable" size="small" :rel-entity="form" :treeApi="this.$API.system.position.treeData" default-expand-all></ex-rel-table>
          </el-tab-pane>
        </el-tabs>
      </template>
    </ex-dialog>
  </template>

  <script>
  import ExRelTable from "@/components/exRelTable/index.vue";
  import ExLabel from "@/components/exLabel/index.vue";
  import ExSelector from "@/components/exSelector/index.vue";
  import exDialog from '@/components/exDialog';

  export default {
    computed: {
    },
    emits: ['success'],
    components: {
		ExSelector,
		ExLabel,
      ExRelTable,
      exDialog
    },
    props: {
    },
    data() {
      return {
        activeName: 'base',
        visible: false,
        form: {},
      }
    },
    methods: {
      //显示
      open(entity) {
        this.form = Object.assign({}, entity);
        this.visible = true;
        this.activeName = "base";
      },
    }
  }
  </script>

  <style scoped>
  h2 {
    font-size: 17px;
    color: #3c4a54;
    padding: 0 0 30px 0;
  }

  [data-theme="dark"] h2 {
    color: #fff;
  }

  </style>
